package com.whf.handler;

import com.whf.exception.SellerAuthorizeException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.ModelAndView;
import sun.awt.ModalExclude;

/**
 * 验证是否登陆中抛出的异常,进行处理
 * 全局异常处理
 */
@ControllerAdvice
public class SellerExceptionHandler {
    @ExceptionHandler(value = SellerAuthorizeException.class)
    public ModelAndView handlerAuthorizeException(){
        //出现异常说明没有正常登陆,直接跳转到登陆页面
        return new ModelAndView("redirect:/seller/login");
    }
}
